home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / gfx / 3d / rayshade40_enh2.lha / ENHANCE / cblob.doc next >
Text File  |  1992-07-14  |  5KB  |  124 lines

  1.  
  2.              Multi-Surfaced Blobs
  3.  
  4. Here it is! The "alpha" code for supporting multiple surfaced blobs
  5. in Rayshade.  I say "alpha" because it, the code, has been
  6. tested, but not rigourously.  It seems simple enough to implement and try
  7. that I feel it should be available to those who want to use it.  Above
  8. all, I want everyone interested in this to have some source with which
  9. to experiment and have some fun!
  10.  
  11. Please send me any comments or suggestions for improving the code,
  12. speeding it up, or just general style issues.
  13.  
  14. I want to thank Mark Podlipec for all his help in getting this running
  15. (read: If it weren't for him I might still be thrashing about
  16. helplessly).  Kudos, of course, to everyone who has helped make
  17. Rayshade available to even the most novice developers, like myself.
  18.  
  19. I have tar'red and compressed only the "necessary and sufficient"
  20. files for making multi-surfaced blobs.  All you need to do is
  21. uncompress and untar the file 'CBlob.tar.Z' in the top level Rayshade
  22. directory and you should have a subdirectory 'cblob' with the
  23. necessary files in it.  Next you need to put them into the their
  24. proper directories(see below) and recompile, but please back up the
  25. original files first! :-) The names of the files in CBlob.tar are
  26. identical to the Rayshade distribution files.
  27.  
  28.               Using Multi-Surfaced Blobs
  29.  
  30. Multi-surfaced blobs have been implemented, at this time, as a new
  31. object.  This object is called a "cblob".  Anything you can do to a
  32. "blob" you can do to a "cblob".  Here's the catch, the syntax for a
  33. "cblob" is different, but only _VERY_ slightly.  The "cblob" has, after
  34. each coordinate triple for a metaball, the metaball's particular
  35. surface specification.  For example, below is the "cblob"
  36. specification derived from Mark's blob example file "blob.ray": 
  37.  
  38. /*
  39.  * Example blob input file, courtesy of Mark Podlipec
  40.  * Modified for multi-surfaced blob (i.e. cblob) by George McGregor
  41.  */
  42. eyep  0.0 -6.0 1.0
  43. lookp 0.0 0.0 0.0
  44. fov 45. 45.
  45. screen 240 240
  46. light 1.4 point 15.  -20. 25.
  47. light 0.7 point 5. -25. 10.
  48.  
  49. surface white ambient .02 .02 .02 diffuse .5 .5 .5 specular .8 .8 .8 specpow 32
  50. surface bland ambient .02 .02 .02 diffuse .5 .5 .5 specular .8 .8 .8 specpow 32
  51.  
  52. /* Note: Seperate surfaces for each metaball... which may not be necessary */
  53. surface crystal diffuse .03 .03 .08
  54.         reflect 0.03 transp 0.96 index 1.5
  55. surface greensmoke diffuse .01 .05 .01 reflect .10 specpow 30 specular .8 .85 .8
  56. surface blueglass diffuse .09 .15 .45 specular .5 .5 .6 reflect .5
  57. surface gold  diffuse 0.22 0.18 0.05 specular .8 .8 .4 ambient .04 .02 .0
  58.     reflect 0.93 specpow 58
  59. surface ceramic diffuse 0.6118 0.6794 0.7471 ambient 0.2039 0.2265 0.2490
  60.   specular .5 .5 .5 specpow 25
  61. surface plaster diffuse 0.6735 0.6059 0.4465 ambient 0.2245 0.2020 0.1388
  62. surface silver diffuse .02 .02 .04 specular .71 .71 .7 reflect .95 specpow 70
  63.  
  64. /*   surface  treshhold strength radius    x      y      z      surface */
  65. /*      |         |         |       |      |      |      |      |   |   */
  66. /*      V         V         V       V      V      V      V      V   V   */
  67. cblob bland      0.6       1.0     1.0   -0.900  0.000  0.000  plaster
  68.                            1.0     1.0    0.900  0.000  0.000  greensmoke
  69.                            1.0     1.0    0.000  0.000 -0.900  ceramic
  70.                            1.0     1.0    0.000  0.000  0.900  silver
  71.  
  72. plane white 0. 0. -3.77   0 0 1
  73.  
  74.  
  75.  
  76. Please note the multiple surface specifications, one for each metaball 
  77. in the "cblob".  As Mark pointed out to me, surfaces are global and it
  78. would be a good idea to make the "cblob"'s surface specification
  79. unique.
  80.  
  81. I am certain that with a better understanding of the yacc parser and a
  82. little more work I can make the "blob"/"cblob" objects into one
  83. description. e.g. the surfaces for the metaballs would be optional and
  84. thus make the single surface "blob" the default case.  Also, it would be
  85. nice to be able to specify a surface once and have that surface used as a
  86. default for subsequent metaballs until a new surface specification is
  87. given.  I have attempted these cases, but the shift/reduce errors and
  88. parsing glitches forced me to getting the "cblob" working first.  I am
  89. hoping Mark, or someone who is more familiar with these sorts of
  90. things can point me in the right direction.
  91.  
  92. I apologize if I have left anything out, and I look forward to any
  93. constructive commentary about this code.  I will be placing this in
  94. our anonymous ftp directory under pub/rayshade as well as at the
  95. weedeater site.
  96.  
  97. Ftp'ing details for ncifcrf.gov:
  98.  
  99.     ftp fcs280s.ncifcrf.gov   -or- ftp 129.43.2.10
  100.  
  101.         [login as "anonymous" and password in user@host form.] 
  102.  
  103.     cd pub/rayshade
  104.  
  105. Now you may get the files. Oh, yes, be sure to set to binary to before
  106. you grab the .Z files.  They should all have the CBlob prefix.
  107.  
  108. The weedeater details have been covered elsewhere.  I will place the
  109. files in the incoming directory. Again, they should all have the CBlob
  110. prefix. 
  111.  
  112. If you have any problems you can reach me at the adresses below.
  113.  
  114. Enjoy!
  115.  
  116. George
  117.  
  118.  
  119.   George McGregor    @    NCI Biomedical Supercomputer Center
  120.   c/o PRI, Inc.        Phone: (301) 846-5789                  
  121.   PO Box B, Bldng. 430  mcgregor@ncifcrf.gov
  122.   Frederick, MD 21702    mcgregor@fcs280s.ncifcrf.gov
  123.  
  124.